<%@page import="com.feib.soeasy.util.CodeTableUtil"%>
<%@page import="com.feib.soeasy.model.UploadFile"%>
<%@page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8"%>
<%@include file="/includes/taglibs.jsp"%>
<%@page import="com.feib.soeasy.util.UserUtil"%>

<script type="text/javascript">
<!--	
$(document).ready(function() {	
	
	$('#printBtn2').click(function() {
		//window.print();
		//doQueryPrintAction();
		divPrint('paymentGroupDiv');//只印目前這筆
	});
	
	
	
	$("[id^='passPaymentBtn-']").click(function() {
		var uploadFilePk = this.id.substring(15);
		//alert(uploadFilePk);
		doPaymentsConfirmAction(uploadFilePk,9);
	});
	$("[id^='cancelPaymentBtn-']").click(function() {
		
		var uploadFilePk = this.id.substring(17);
		//alert(uploadFilePk);
		doPaymentsConfirmAction(uploadFilePk,5);
	});
	$("[id^='showPaymentBtn-']").click(function() {
		var uploadFilePk = this.id.substring(15);
		doQueryFilePaymentsAction(1, uploadFilePk);
	});	
	$("#reportForm").each(function(i){
		$(this).find("th:first-child").addClass("first");
		$(this).find("td:first-child").addClass("first");
		$(this).find("tr:has(td):odd").addClass("odd");
		$(this).find("tr:has(td):even").addClass("even");
	});
	
});
//-->
</script>

<c:if test="${actionBean.countPayemntItem > 0 }">
<table id="reportForm">
	<tr>
		<th colspan="3">
			<p><c:out value="${actionBean.fileName}"/></p>
			總金額：<fmt:formatNumber value="${actionBean.totalPaymentAmount}" pattern="##,###" /><br>
			總筆數：<fmt:formatNumber value="${actionBean.countPayemntItem}" pattern="##,###" />筆
		</th>
	</tr>
	<tr>
		<th>收費項目</th>
		<th>筆數</th>
		<th>金額</th>
	</tr>
	<c:forEach items="${actionBean.queryPaymentItemResult.paginatedList}" var="vars" varStatus="rowstat">
	<tr>
		<td>
			<c:out value="${vars.itemName}"/>
		</td>
		<td align="right">
			<fmt:formatNumber value="${vars.itemCounts}" pattern="##,###" />
		</td>
		<td align="right">
			<fmt:formatNumber value="${vars.itemAmounts}" pattern="##,###" />
		</td>
	</tr>
	</c:forEach>
</table>
<div id="paginationBar">
			<input type="button" 
				id="passPaymentBtn-<c:out value='${actionBean.qryUploadFile.uploadFilePk}'/>" 
				name="passPaymentBtn-<c:out value='${actionBean.qryUploadFile.uploadFilePk}'/>" 
				value="放行">
			<input type="button" 
				id="cancelPaymentBtn-<c:out value='${actionBean.qryUploadFile.uploadFilePk}'/>" 
				name="cancelPaymentBtn-<c:out value='${actionBean.qryUploadFile.uploadFilePk}'/>" 
				value="退件">
			<input type="button" 
				id="showPaymentBtn-<c:out value='${actionBean.qryUploadFile.uploadFilePk}'/>" 
				name="showPaymentBtn-<c:out value='${actionBean.qryUploadFile.uploadFilePk}'/>" 
				value="明細">
					<input type="button" id="printBtn2" value="列印" />	
</div>
</c:if>
<c:if test="${actionBean.countPayemntItem == 0 }">
	<div id="queryNothingBlockDiv" style="display: none;">
		<table id="listTable">
			<tr>
				<th>
					查無資料
				</th>
			</tr>
		</table>
	</div>	
</c:if>